package com.core.family.admin.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.core.common.domain.response.R;
import com.core.common.utils.JwtUtil;
import com.core.family.admin.service.PlatUserExtendService;
import com.core.family.biz.yizhao.domain.dto.YzUserDto;
import com.core.family.biz.yizhao.domain.po.YzUserExtend;
import com.core.family.biz.yizhao.service.YzUserExtendService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.core.family.admin.mapper.PlatUserMapper;
import com.core.family.admin.domain.po.PlatUser;
import com.core.family.admin.service.PlatUserService;
import com.core.common.gen.BaseServiceImpl;

import java.util.Objects;


/**
 * @author honglei
 * @version 1.0
 * @time: 2023-6-14 17:05:08
 * @Description 服务实现层 平台用户
 */
@Slf4j
@Service
public class PlatUserServiceImpl extends BaseServiceImpl<PlatUserMapper, PlatUser> implements PlatUserService {


    @Override
    public PlatUser queryByOpenid(String openId) {
        log.info("queryByOpenid.openId:{}",openId);
        if (Objects.isNull(openId)){
            return null;
        }
        LambdaQueryWrapper<PlatUser> wrapper= Wrappers.lambdaQuery();
        wrapper.eq(PlatUser::getOpenid,openId);
        PlatUser user= this.baseMapper.selectOne(wrapper);
        return user;
    }
}

